//
//  MyFreeSixSelectTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/12/4.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "MyFreeSixSelectTableViewCell.h"

@implementation MyFreeSixSelectTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        CGFloat butWidth = (KScreenWidth - kWidthProportion_In_iPhoneTriploid(30))/4;
        NSArray * butArr = @[@"我的求购",@"我的报价",@"我的钱包",@"发票管理"];
        for (int i=0; i<4; i++) {
            GLGWButton * topFourBut = [[GLGWButton alloc] initWithTitle:butArr[i] titleLableFont:SYSTEMFONT(13) titleLableColor:[UIColor colorWithHexString:@"#666666"] inSuperView:self];
            [topFourBut mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.equalTo(self.mas_left).offset(kWidthProportion_In_iPhoneTriploid(15)+butWidth*i);
                make.top.equalTo(self.mas_top).offset(kHeightProportion_In_iPhoneTriploid(10));
                make.width.equalTo(@(butWidth));
                make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(72)));
            }];
            topFourBut.backgroundColor = kRandomColor;
            topFourBut.tag = 217+i;
            [topFourBut addTarget:self action:@selector(sixSelectAction:) forControlEvents:UIControlEventTouchUpInside];
        }
        //
        CGFloat bottonButWidth = KScreenWidth/4+kWidthProportion_In_iPhoneTriploid(12);
        NSArray * bottomArr = @[@"我服务的买家",@"我的店铺资料"];
        for (int j=0; j<2; j++) {
            GLGWButton * bottomBut = [[GLGWButton alloc] initWithTitle:bottomArr[j] titleLableFont:SYSTEMFONT(13) titleLableColor:[UIColor colorWithHexString:@"#666666"] inSuperView:self];
            [bottomBut mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.equalTo(self.mas_left).offset(bottonButWidth*j);
                make.top.equalTo(self.mas_top).offset(kHeightProportion_In_iPhoneTriploid(85));
                make.width.equalTo(@(bottonButWidth));
                make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(72)));
            }];
            bottomBut.backgroundColor = kRandomColor;
            bottomBut.tag = 221+j;
            [bottomBut addTarget:self action:@selector(sixSelectAction:) forControlEvents:UIControlEventTouchUpInside];
        }
    }
    return self;
}

-(void)sixSelectAction:(GLGWButton *)sender{
    if (self.Block_MySeverInfor) {
        self.Block_MySeverInfor(sender);
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
